﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.ComponentModel.DataAnnotations;

namespace LetLord.Models
{
    public class LetLordContext : DbContext
    {
        public DbSet<LetLord.Models.UserProfile>            UserProfile { get; set; }           // 1 DbSet for superclass UserProfile
        public DbSet<LetLord.Models.Image>                  Image { get; set; }                 // 1 DbSet for superclass Image
        public DbSet<LetLord.Models.ResidentialProperty>    ResidentialProperty { get; set; }
        public DbSet<LetLord.Models.TenantGroupMember>      TenantGroupMember { get; set; }
        public DbSet<LetLord.Models.Viewing>                Viewing { get; set; }
        public DbSet<LetLord.Models.TenantPreferences>      TenantPreferences { get; set; }
        public DbSet<LetLord.Models.LandlordPreferences>    LandlordPreferences { get; set; }
        public DbSet<LetLord.Models.Address>                Address { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
            modelBuilder.Conventions.Remove<ManyToManyCascadeDeleteConvention>();
        }

        public DbSet<LetLord.Models.ReferencePhoto> ReferencePhotoes { get; set; }

    }
}